import 'dart:convert';

import 'package:ichinesereader/models/student/ProfileStudent.dart';

AssignmentStudentData assignmentStudentDataFromJson(String str) =>
    AssignmentStudentData.fromJson(json.decode(str));

String assignmentStudentDataToJson(AssignmentStudentData data) =>
    json.encode(data.toJson());

class AssignmentStudentData {
  AssignmentStudentData({
    this.student,
    this.complete,
    this.requiredBooks,
    this.totalBooks,
    this.overallComplete,
    this.assignmentName,
    this.className,
    this.workType,
    this.creatDate,
    this.startDate,
    this.endDate,
    this.recording,
    this.writing,
  });

  ProfileStudent? student;
  bool? complete;
  int? requiredBooks;
  int? totalBooks;
  int? overallComplete;
  String? assignmentName;
  String? className;
  String? workType;
  int? creatDate;
  int? startDate;
  int? endDate;
  bool? recording;
  bool? writing;

  factory AssignmentStudentData.fromJson(Map<String, dynamic> json) =>
      AssignmentStudentData(
        student: ProfileStudent.fromJson(json["student"]),
        complete: json["complete"],
        requiredBooks: json["requiredBooks"],
        totalBooks: json["totalBooks"],
        overallComplete: json["overallComplete"],
        assignmentName: json["assignmentName"],
        className: json["className"],
        workType: json["workType"],
        creatDate: json["creatDate"],
        startDate: json["startDate"],
        endDate: json["endDate"],
        recording: json["recording"],
        writing: json["writing"],
      );

  Map<String, dynamic> toJson() => {
        "student": student != null ? student?.toJson() : null,
        "complete": complete,
        "requiredBooks": requiredBooks,
        "totalBooks": totalBooks,
        "overallComplete": overallComplete,
        "assignmentName": assignmentName,
        "className": className,
        "workType": workType,
        "creatDate": creatDate,
        "startDate": startDate,
        "endDate": endDate,
        "recording": recording,
        "writing": writing,
      };
}
